<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>数组</title>
</head>

<body>
  <script>
    const movies = ['情圣', '误杀', '唐探'];
    const star = ['王太利', '肖央', '曾毅', '玲花'];
    const mix1 = movies.concat(star);
    const mix2 = [...movies, ...star];
    console.log(mix1); //(7) ['情圣', '误杀', '唐探', '王太利', '肖央', '曾毅', '玲花']
    console.log(mix2); //(7) ['情圣', '误杀', '唐探', '王太利', '肖央', '曾毅', '玲花']

    const str1 = [1, 2, 3];
    const str2 = [...str1];
    // 如果里面有引用数据类型，也是浅拷贝
    // 没有的话，完全复制一个数组
    console.log(str2); //(3) [1, 2, 3]
  </script>
</body>

</html>